package com.itqf.springdubbouserconsumer.com.itqf.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itqf.entity.Order;
import com.itqf.service.OrderService;
import com.sun.org.apache.bcel.internal.generic.NEW;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 作者：李宏飞
 * 项目名： spring-dubbp
 * 时间：2019/12/12  11:08
 * 描述:
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Reference
   private OrderService orderService;

    @GetMapping("/list/{id}")
    public List<Order> findBYId(@PathVariable Integer id){
        List<Order> orderByid = orderService.findOrderByid(id);
        System.out.println("orderByid = " + orderByid);
        return orderByid;
    }

}
